<template>
  <div>{{ count }}</div>
  <div>{{ num }}</div>
  <button @click="count++">++</button>
  <button @click="num++">++</button>
  <button @click="jump">跳转</button>
</template>
<script setup>
import { storeToRefs } from "pinia";
import { useRouter } from "vue-router";
// storeToRefs useStore() 展开use store 返回的对象，变成相应数据
import { useStore } from "../stores/index";
const { count, num } = storeToRefs(useStore());
const { push } = useRouter();

const jump = () => {
  push({
    name: "about",
    params: {
      name: "小李",
    },
  });
};
</script>
